<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>伪类和伪元素</title>
    <style>
        body {
            background: #ed6000;
            color: #fff2e5;
        }
        input{
            font-size: 3em;
            width: 200px;
            height: 50px;
            border-radius: 10px;
        }
        input:out-of-range:focus{background: gold}
        input:out-of-range + h2::after{content: "超出范围";}
    </style>
</head>
<body>
<h1>请输入数字</h1>
<input type="number" min="1" max="10">
<h2>结果:</h2>
</body>
</html>